package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.net.*;
	import flash.events.*;
	import flash.utils.*;

	import cmodule.xls.CLibInit;
	public class EchoTest extends Sprite
	{
		private var text:TextField = new TextField();
		public function EchoTest()
		{
			//var request:URLRequest = new URLRequest("xls.xls");
			var request:URLRequest = new URLRequest("RAR.doc");
			var loader:URLLoader = new URLLoader();
			loader.dataFormat= URLLoaderDataFormat.BINARY;
			loader.load(request);
			loader.addEventListener(Event.COMPLETE,loaded);
		}
		private function loaded(e:Event):void
		{
			addChild(text);
			text.wordWrap = true;
			text.width = stage.stageWidth;
			text.height = stage.stageHeight;
			text.border = true;
			if(e.type == Event.COMPLETE){
				var loader:CLibInit = new CLibInit;
				var lib:Object = loader.init();
				//var s:String = lib.parseXls(ByteArray(e.target.data));
				var s:String = lib.parseDoc(ByteArray(e.target.data));
				trace(s);
				text.text = String(s);
			}else{
				text.text = String(e);
			}
		}
	}
}
